<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/taglibs.jsp"%>
<sx:head/>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="StyleSheet" type="text/css" href="<%=request.getContextPath()%>/pages/css/common.css"></link>
<link rel="StyleSheet" type="text/css" href="<%=request.getContextPath()%>/pages/css/password.css"></link>
<script type="text/javascript" src="<%=request.getContextPath()%>/pages/js/password.js" ></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/pages/js/jquery-1.5.js" ></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/pages/js/jquery.validate.min.js" ></script>
<script type="text/javascript">
	$().ready(function(){
		$("#createCategoryForm").validate({
				rules: {
					name : {
						required: true,
						minlength: 2
					},
					code : {
						required: true,
						email: true
					}
				},
				messages: {
					name : {
						required: "Please enter sub category name",
						minlength: "Category name must consist of at least 2 characters"
					},
					code : {
						required: "Please enter sub category code",
						minlength: "Category code must consist of at least 4 characters"
					}
				}
		});
	});
	
</script>
<title>DFASS</title>
</head>
<body>
	<div class="headerContent" align="center">
		<div class="header">
		<%@ include file="../inc/logged_top.jsp" %>			
		</div>
		<div id="nav_container">
		<%@ include file="../menu/mb_menu_inventory.jsp" %>
	    </div>
	</div>
	<div class="bodyContent" align="center">
		<table><tr><td>&nbsp;</td></tr></table>
		<!-- This Empty Table is Required before the content of the body -->
		<s:form theme="simple" id="createCategoryForm" name="createCategoryForm" action="createSubCategory">		
			<table class="tblAdminNormal">
				<thead>
					<tr>
						
						<td colspan="4">Sub Category Creation</td>
					</tr>
				</thead>
				<tbody>
				    <tr>
				        <td>Category</td>
				        <td>
							<sx:autocompleter name="cat" list="categories" autoComplete="true"	
																	listKey="id" listValue="name"  />				        	
						</td>
				    </tr>
				    <tr>
				        <td>Code</td>
				        <td><s:textfield name="code" cssStyle="width:150px" /></td>
				    </tr>
				    <tr>
				        <td>Name</td>
				        <td><s:textfield name="name" cssStyle="width:150px" /></td>
				    </tr>
				    <tr>
				        <td>Description</td>
				        <td><s:textfield name="desc" cssStyle="width:150px" /></td>
				    </tr>
				    <tr>
				        <td></td> 
				        <td><s:submit value="Create Sub Category" cssClass="button" /></td> 
				    </tr>
				    <tr>
				        <td colspan="2"><s:actionmessage cssClass="successMsg" />
				        			<s:fielderror cssClass="errorMsg" /></td> 
				    </tr>
				</tbody>
			</table>		
		</s:form>
	</div>				
	
	<div class="footerContent" align="center">
		<div class="footer">
			<%@ include file="/pages/inc/footer.jsp" %>
		</div>
	</div>
</body>
</html>